package org.bulu.project.system.mapper;

import cn.hutool.core.date.DateTime;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;
import org.bulu.project.system.model.dto.VideoSreachDto;
import org.bulu.project.system.model.dto.VideoUploadInfoDTO;
import org.bulu.project.system.model.entity.Video;
import org.bulu.project.system.model.vo.VideoVo;

import java.util.List;


public interface VideoMapper {
    Integer addVideo(Video video);

    List<Video> getVideosByIds(Long uid);

    int delVideo(Integer vid);

    int updateVideo(Video video);

    @Select("select * from video where vid = #{vid}")
    Video findVideoById(Integer vid);
    @Update("UPDATE video set status=3 , delete_date=#{deleteDate} WHERE vid=#{vid}")
    Integer deleteVideo(@Param(value = "vid") Integer vid,@Param(value = "deleteDate") DateTime deleteDate);
    @Delete("delete from video where vid = #{vid}")
    Integer deleteVideo(Integer vid);
    Video queryVideoByVid(Integer vid);
    List<VideoVo> findVideo(VideoSreachDto video);
}
